#!/usr/bin/env python
# -*- coding: utf-8 -*-
# type: ignore
"""
author : GQ
project : SwiftTestPlatform
date : 2022/3/25
"""

from lxhc_testcase.testconf import host, users
from apitest.utils.excelhandle import ExcelHandle

EH_HOST = ExcelHandle(host())
EH_USER = ExcelHandle(users())

is_prd_env = 0  # 0 = True 测试环境，1：生产环境
is_use_db = 0

host_target = "B2" if is_prd_env else "A2"
user_target = "D2" if is_prd_env else "A2"
pwd_target = "E2" if is_prd_env else "B2"
token_target = "F2" if is_prd_env else "C2"


class Constant(object):
    '''常量配置'''
    token_target = "F2" if is_prd_env else "C2"
    lxhc_host = EH_HOST.read_target(host_target)
    user = EH_USER.read_target(user_target)
    pwd = EH_USER.read_target(pwd_target)

    def get_user(self):
        return EH_USER.read_target(user_target)

    def get_pwd(self):
        return EH_USER.read_target(pwd_target)

    def get_token(self):
        return EH_USER.read_target(token_target)

    def user_login(self):
        return self.lxhc_host + '/api/front/login'

    def user_info(self):
        return self.lxhc_host + '/api/front/user'

